/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Minh Duong
 */
@Entity
@Table(name = "TicketsCategory", catalog = "EasyTickets", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TicketsCategory.findAll", query = "SELECT t FROM TicketsCategory t"),
    @NamedQuery(name = "TicketsCategory.findByTcID", query = "SELECT t FROM TicketsCategory t WHERE t.tcID = :tcID"),
    @NamedQuery(name = "TicketsCategory.findByTcName", query = "SELECT t FROM TicketsCategory t WHERE t.tcName = :tcName"),
    @NamedQuery(name = "TicketsCategory.findByPrice", query = "SELECT t FROM TicketsCategory t WHERE t.price = :price")})
public class TicketsCategory implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "TcID", nullable = false)
    private Integer tcID;
    @Basic(optional = false)
    @Column(name = "TcName", nullable = false, length = 50)
    private String tcName;
    @Basic(optional = false)
    @Column(name = "Price", nullable = false)
    private double price;
    @OneToMany(mappedBy = "ticketsCategory")
    private List<Tickets> ticketsList;

    public TicketsCategory() {
    }

    public TicketsCategory(Integer tcID) {
        this.tcID = tcID;
    }

    public TicketsCategory(Integer tcID, String tcName, double price) {
        this.tcID = tcID;
        this.tcName = tcName;
        this.price = price;
    }

    public Integer getTcID() {
        return tcID;
    }

    public void setTcID(Integer tcID) {
        this.tcID = tcID;
    }

    public String getTcName() {
        return tcName;
    }

    public void setTcName(String tcName) {
        this.tcName = tcName;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public List<Tickets> getTicketsList() {
        return ticketsList;
    }

    public void setTicketsList(List<Tickets> ticketsList) {
        this.ticketsList = ticketsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tcID != null ? tcID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TicketsCategory)) {
            return false;
        }
        TicketsCategory other = (TicketsCategory) object;
        if ((this.tcID == null && other.tcID != null) || (this.tcID != null && !this.tcID.equals(other.tcID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TicketsCategory[tcID=" + tcID + "]";
    }
}
